<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>学校信息</title>
		<link rel="stylesheet" type="text/css" href="asserts/bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
	
		<!-- js插件 -->
		<script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
		<script src="${pageContext.request.contextPath}/asserts/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/asserts/bootstrapValidate/css/bootstrapValidator.min.css"/>
 	   <script src="${pageContext.request.contextPath}/asserts/bootstrapValidate/js/bootstrapValidator.min.js"></script>
			<link rel="stylesheet" href="asserts/font-awesome-4.7.0/css/font-awesome.min.css" />

		<link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css">
	</head>
	
<body>
	<ol class="breadcrumb">
					<li><i class="fa fa-dashboard"></i>    <a href="${pageContext.request.contextPath}/img/flow.png" target="_blank">受理资助流程查看</a> </li>
				</ol>
				<div class="container-fluid">
					 
					<!-- 统计信息 -->
					<div class="count">
						<div class="count-item">
						<span class="title">通知公告</span> 
						<div id="noticeInfo">
					 		<!--   <div class="li-item">
							  		<p style="float:left">关于新型冠状病毒的防护与措施关...... </p>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div>
							      <div class="li-item">
							  		<p style="float:left">关于新型冠状病毒的防护与措施关...... </p>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div>
							      <div class="li-item">
							  		<p style="float:left">关于新型冠状病毒的防护与措施关...... </p>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div>
							      <div class="li-item">
							  		<p style="float:left">关于新型冠状病毒的防护与措施关...... </p>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div>
							      <div class="li-item">
							  		<p style="float:left">关于新型冠状病毒的防护与措施关...... </p>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div> -->
							    
						</div>
							    <div style="clear:both">
							 	 <p style="text-align:right"> <a href="notice/listFront" target="_blank">更多</a> </p> 
							 	 </div>
						</div>
						<div class="count-item2">
						<span class="title">政策文件</span> 
						<div id="policyInfo">
							<!--  <div class="li-item">
							  		<a href="#" target="_blank"><p style="float:left">关于新型冠状病毒的防护与措施关...... </p></a>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div>
							      <div class="li-item">
							  		<p style="float:left">关于新型冠状病毒的防护与措施关...... </p>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div>
							      <div class="li-item">
							  		<p style="float:left">关于新型冠状病毒的防护与措施关...... </p>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div>
							      <div class="li-item">
							  		<p style="float:left">关于新型冠状病毒的防护与措施关...... </p>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div>
							      <div class="li-item">
							  		<p style="float:left">关于新型冠状病毒的防护与措施关...... </p>
							        <p style="float:right;text-align: right">2020-03-10</p> 
							    </div> -->
						</div>
							    <div style="clear:both">
							 	 <p style="text-align:right"> <a href="policy/listFront" target="_blank" >更多</a> </p> 
							 	 </div>
						</div>
					<!-- 	<div class="count-item">
							<span class="fa fa-comment  fa-2x"></span><br>
							受理申请<br>
							<span class="number"></span>
						</div> -->
				<!-- 		<div class="count-item">
							<span class="fa fa-list fa-2x"></span><br>
							政策宣传<br>
							<span class="number"></span>
						</div>
						<div class="count-item">
							<span class="fa fa-comment fa-2x"></span><br>
							数据上报<br>
							<span class="number"></span>
						</div>
						<div class="count-item">
							<span class="fa fa-tags fa-2x"></span><br>
							数据统计<br>
							<span class="number"></span>
						</div> -->
					 
					</div><!-- 统计信息end -->
					<blockquote>
						登录信息
					</blockquote>
					<!-- 系统信息 -->
					<div class="stat">
						<table class="table table-striped">
							<tr>
								<td>登录人:</td>
								<td>${user.usercode}</td>
								<td>用户级别:</td>
								<td>${user.userlevel}</td>
							</tr>
							<tr>
								<td>本次登录IP:</td>
								<td>${pageContext.request.remoteAddr}</td>
								<td>本次登录时间:</td>
								<td><fmt:formatDate value="${userLoginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
								</td>
							</tr>
							<tr>
								<td>当前在线人数:</td>
								<td>${count}</td>
							 	<td>状态:</td>
								<td>启用</td>
							</tr>
						</table>
					</div><!-- 系统信息end -->
				</div>
	
</body>
</html>
<script type="text/javascript">
	// ajax 查询5条最新的公告信息  
	$(function(){
		
		 
		  $.ajax({
				url : 'notice/getList',
				type : "get",
				dataType : "json",
				success : function(data) {
					 
					if(data!=null){
						for(var i=0;i<data.length;i++){
							var obj=data[i];
							var title=data[i].name;
							if(title.length>25){
								title=title.substring(0,25)+"......";
							}
						 
							var info=" <div class=\"li-item\"><a href=\"notice/detailnotice?type=1&id="+obj.id+"\" target=\"_blank\" title=\""+data[i].name+"\"> <p style=\"float:left\">"+title+"</p></a>"
							+"<p style=\"float:right;text-align: right\">"+format(obj.createdate)+"</p></div>";
							
							$("#noticeInfo").append(info);
						}
					} 
				},
				error : function(xhr) {
					 
				}
			});
		  
		  $.ajax({
				url : 'policy/getList',
				type : "get",
				dataType : "json",
				success : function(data) {
					 
					if(data!=null){
						for(var i=0;i<data.length;i++){
							var obj=data[i];
							var title=data[i].name;
							if(title.length>25){
								title=title.substring(0,25)+"......";
							}
						 
							var info=" <div class=\"li-item\"><a href=\"policy/detailpolicy?id="+obj.id+"\" target=\"_blank\" title=\""+data[i].name+"\"> <p style=\"float:left\">"+title+"</p></a>"
							+"<p style=\"float:right;text-align: right\">"+format(obj.createdate)+"</p></div>";
							
							$("#policyInfo").append(info);
						}
					} 
				},
				error : function(xhr) {
					 
				}
			});
		
		
	})

	
	function format(dd){
		var str="";
		var date = new Date(dd);
		str+=date.getFullYear()+"-";
		var m=date.getMonth()+1;
		if(m<=9){
			str+="0"+m+"-";
		}else{
			str+=m+"-"
		}
		var d=date.getDate();
		if(d<=9){;
			str+="0"+d;
		}else{
			str+=d
		}
		return str;
	}
</script>
